package com.ruoyi.system.api.client;

import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.system.api.domain.News;
import com.ruoyi.system.api.fallback.NewsClientFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(name = "ruoyi-heima-news", path = "/news", fallbackFactory = NewsClientFallbackFactory.class)
public interface NewsClient {
    @PostMapping
    public AjaxResult add(@RequestBody News news);

    @PutMapping
    public AjaxResult edit(@RequestBody News news);

    @DeleteMapping("/{newsIds}")
    public AjaxResult remove(@PathVariable("newsIds") Long[] newsIds);
}
